package com.mall.auth.controller;

import com.alibaba.fastjson.JSON;
import com.mall.common.response.ResponseResultEnum;
import com.mall.common.response.ServerResponse;
import com.mall.common.vo.auth.CustomerLoginReqVo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/auth")
public class AuthController {

    private static final Logger log = LoggerFactory.getLogger(AuthController.class);


    @PostMapping("/login")
    public ServerResponse login(@RequestBody CustomerLoginReqVo reqVo){
        log.info("用户登录","请求参数", JSON.toJSON(reqVo));
        if(null == reqVo || StringUtils.isAnyEmpty(reqVo.getUserName(),reqVo.getPassword())){
            log.info("用户登录","请求参数为空");
            return  ServerResponse.buildError(ResponseResultEnum.PARA_NOT_EXISTS);
        }



        return null;

    }



}
